"""测试修改字段

Revision ID: e8d5782710c7
Revises: 
Create Date: 2025-08-17 21:30:11.866796

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
import sqlmodel

# revision identifiers, used by Alembic.
revision: str = 'e8d5782710c7'
down_revision: Union[str, Sequence[str], None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('db_test', sa.Column('password_hash', sqlmodel.sql.sqltypes.AutoString(), nullable=False))
    op.alter_column('db_test', 'group_id',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True)
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('db_test', 'group_id',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=False)
    op.drop_column('db_test', 'password_hash')
    # ### end Alembic commands ###
